let http = config.依赖.replace("ycl.js", "");
let CT = Date.now();

function sourl() {
    try {
        eval("var sojl = " + readFile("hiker://files/cache/Yue/sojl.js"), 0);
    } catch (e) {
        var sojl = "";
    }
    if (sojl == "") {
        var sojl = [input];
    } else {
        var sojl = sojl.concat(input); //增加
    };
    sojl.unshift(input); //新增在最前面

    //利用 includes() 去重
    /* let newArr = [];
     wenj.forEach((item) => {
         if (!newArr.includes(item)) {
             newArr.push(item);
         }
     })*/
    //利用 filter() 去重
    let sojl = sojl.filter((item, index) => sojl.indexOf(item) === index);

    if (sojl.length > 20) {
        sojl.splice(-1, 1);
    };
    saveFile("hiker://files/cache/Yue/sojl.js", JSON.stringify(sojl), 0);
    putMyVar("Mysou", input);
    if (getMyVar('影搜') !== '1') {
        return $("hiker://empty#noRecordHistory##noHistory#fypage").rule(() => {
            require(config.依赖);
            yso()
        });
    } else {
        refreshPage();
        return "hiker://empty";
    }
};

//分隔
let game = "";
if (getItem("全屏", "off") == "on") {
    game = "##gameTheme#";
} else {
    game = "#";
};

//更新
function gx() {
    require(http + "gx.js");
};

//设置
function she() {
    require(http + "she.js");
};

//首页
function sy() {
    putMyVar("vers", MY_RULE.version);
    gx();
    require(http + "sy.js");
};

//影搜
function yso() {
    require(http + "yso.js");
};

//二级
function erji() {
    require(http + "erji.js");
};

//正文
function content() {
    require(http + "content.js");
};

//搜索
function sou() {
    js: var d = [];
    let input = MY_URL.split("##")[1];
    d.push({
        title: "搜索\t" + input,
        url: $("hiker://empty#noRecordHistory##noHistory#fypage").rule((input) => {
            putMyVar("Mysou", input);
            require(config.依赖);
            yso()
        }, input),
        col_type: "text_1",
        extra: {
            erji: "1",
        }
    });
    setResult(d);
};
